<template>
    <el-main>
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="用户名">
                <el-input v-model="form.username"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input v-model="form.password"></el-input>
            </el-form-item>
            <el-button type="primary" @click="onSubmit">登录</el-button>
        </el-form>
    </el-main>
</template>

<script>
    export default {
        data() {
            return {
                form: {
                    username: '',
                    password:'',
                         
                }
            }
        },
        methods: {
            onSubmit() {
                this.axios.post("http://localhost:9999/api/login/user/login",this.form).then((response) => {
                    console.log(response.data)
                    sessionStorage.setItem("username",this.form.username);
                    this.$router.push("/Wen")
                })
            }
        }
    }
</script>